<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box {
            width: 200px;
            height: 200px;
            background-color: rgb(123, 185, 226);
        }
    </style>
</head>

<body>
    <div id="box">
    </div>
    <script>
        var oBox = document.getElementById('box');
        oBox.onclick = function() {
            alert('你好,世界！')
        }

        oBox.ondblclick = function() {
            alert('鼠标双击')
        }
        oBox.onmousedown = function() {
            console.log('我是onmousedown');
        }

        oBox.onmouseup = function() {
            console.log('我是onmouseup');
        }

        oBox.onmouseenter = function() {
            console.log('我是onmouseenter');
        }

        oBox.onmouseleave = function() {
            console.log('我是onmouseleave');
        }

        oBox.onmousemove = function() {
            console.log('我是onmousemove');
        }
    </script>
</body>

</html>